﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace ALDIOrganizer
{
    public static class EmployeeExtensions
    {
        public static Employee AsEmployee(this DataRow row)
        {
            return new Employee(row);
        }

        public static Int64 ID(this Employee e)
        {
            return (Int64)e.row[0];
        }

        public static string FirstName(this Employee e)
        {
            return (string)e.row[1];
        }

        public static string lastName(this Employee e)
        {
            return (string)e.row[2];
        }

        public static string phone(this Employee e)
        {
            return (string)e.row[3];
        }

        public static string mobile(this Employee e)
        {
            return (string)e.row[4];
        }

        public static DateTime birthDate(this Employee e)
        {
            return (DateTime)e.row[5];
        }

        public static bool Sex(this Employee e)
        {
            return (bool)e.row[6];
        }

        public static string address(this Employee e)
        {
            return (string)e.row[7];
        }

        public static string NIN(this Employee e)
        {
            return (string)e.row[8];
        }

        
    }
}
